﻿using System;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt.redshift
{
	// Token: 0x02000100 RID: 256
	public class TRedshiftAlterGroup : TCustomSqlStatement
	{
		// Token: 0x17000172 RID: 370
		// (get) Token: 0x06000868 RID: 2152 RVA: 0x00301F99 File Offset: 0x00300199
		// (set) Token: 0x06000869 RID: 2153 RVA: 0x00301FA1 File Offset: 0x003001A1
		public virtual EAlterGroup AlterGroupType
		{
			get
			{
				return this.alterGroupType;
			}
			set
			{
				this.alterGroupType = value;
			}
		}

		// Token: 0x17000173 RID: 371
		// (get) Token: 0x0600086A RID: 2154 RVA: 0x00301FAA File Offset: 0x003001AA
		// (set) Token: 0x0600086B RID: 2155 RVA: 0x00301FB2 File Offset: 0x003001B2
		public virtual TObjectName GroupName
		{
			get
			{
				return this.groupName;
			}
			set
			{
				this.groupName = value;
			}
		}

		// Token: 0x17000174 RID: 372
		// (get) Token: 0x0600086C RID: 2156 RVA: 0x00301FBB File Offset: 0x003001BB
		// (set) Token: 0x0600086D RID: 2157 RVA: 0x00301FC3 File Offset: 0x003001C3
		public virtual TObjectName NewGroupName
		{
			get
			{
				return this.newGroupName;
			}
			set
			{
				this.newGroupName = value;
			}
		}

		// Token: 0x17000175 RID: 373
		// (get) Token: 0x0600086E RID: 2158 RVA: 0x00301FCC File Offset: 0x003001CC
		// (set) Token: 0x0600086F RID: 2159 RVA: 0x00301FD4 File Offset: 0x003001D4
		public virtual TObjectNameList UserList
		{
			get
			{
				return this.userList;
			}
			set
			{
				this.userList = value;
			}
		}

		// Token: 0x06000870 RID: 2160 RVA: 0x00301FDD File Offset: 0x003001DD
		public TRedshiftAlterGroup(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstredshiftAlterGroup;
		}

		// Token: 0x06000871 RID: 2161 RVA: 0x00301FF4 File Offset: 0x003001F4
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			base.doParseStatement(psql);
			TDummy tdummy = (TDummy)this.rootNode;
			this.groupName = (TObjectName)tdummy.node1;
			switch (tdummy.int1)
			{
			case 1:
				this.alterGroupType = EAlterGroup.eagAddUser;
				this.userList = (TObjectNameList)tdummy.list1;
				break;
			case 2:
				this.alterGroupType = EAlterGroup.eagDropUser;
				this.userList = (TObjectNameList)tdummy.list1;
				break;
			case 3:
				this.alterGroupType = EAlterGroup.eagRename;
				this.newGroupName = (TObjectName)tdummy.node2;
				break;
			}
			return 0;
		}

		// Token: 0x06000872 RID: 2162 RVA: 0x0030209A File Offset: 0x0030029A
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000873 RID: 2163 RVA: 0x003020AA File Offset: 0x003002AA
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x04001212 RID: 4626
		private TObjectName groupName;

		// Token: 0x04001213 RID: 4627
		private TObjectName newGroupName;

		// Token: 0x04001214 RID: 4628
		private TObjectNameList userList;

		// Token: 0x04001215 RID: 4629
		private EAlterGroup alterGroupType;
	}
}
